package cn.bisoft.java.bean.entity;

import java.io.Serializable;



/**
 * This is an object that contains data related to the acl_permission table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="acl_permission"
 */

public abstract class BaseAclPermission  implements Serializable {

	private static final long serialVersionUID = 1L;
	public static String REF = "AclPermission";
	public static String PROP_PERMISSION_NAME = "permission_name";
	public static String PROP_PERMISSION_ID = "permission_id";


	// constructors
	public BaseAclPermission () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseAclPermission (java.lang.Integer permission_id) {
		this.setPermission_id(permission_id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseAclPermission (
		java.lang.Integer permission_id,
		java.lang.String permission_name) {

		this.setPermission_id(permission_id);
		this.setPermission_name(permission_name);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer permission_id;

	// fields
	private java.lang.String permission_name;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="permission_id"
     */
	public java.lang.Integer getPermission_id () {
		return permission_id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param permission_id the new ID
	 */
	public void setPermission_id (java.lang.Integer permission_id) {
		this.permission_id = permission_id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: permission_name
	 */
	public java.lang.String getPermission_name () {
		return permission_name;
	}

	/**
	 * Set the value related to the column: permission_name
	 * @param permission_name the permission_name value
	 */
	public void setPermission_name (java.lang.String permission_name) {
		this.permission_name = permission_name;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof AclPermission)) return false;
		else {
			AclPermission aclPermission = (AclPermission) obj;
			if (null == this.getPermission_id() || null == aclPermission.getPermission_id()) return false;
			else return (this.getPermission_id().equals(aclPermission.getPermission_id()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getPermission_id()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getPermission_id().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}